package auth

import (
	"game-simple/internal/framework/auth/controllers"
	"game-simple/internal/framework/router"
)

// getAuthRoutes 获取认证相关路由
func getAuthRoutes(ctrl *controllers.Controller) []router.Config {
	return []router.Config{
		{
			Method:   "POST",
			Path:     "/login",
			Handler:  ctrl.Login,
			NeedAuth: false,
		},
		{
			Method:   "POST",
			Path:     "/refresh",
			Handler:  ctrl.RefreshToken,
			NeedAuth: false,
		},
		{
			Method:   "POST",
			Path:     "/logout",
			Handler:  ctrl.Logout,
			NeedAuth: true,
		},
		{
			Method:   "GET",
			Path:     "/me",
			Handler:  ctrl.GetCurrentUser,
			NeedAuth: true,
		},
	}
}

// getUserRoutes 获取用户相关路由
func getUserRoutes(userCtrl *controllers.UserController) []router.Config {
	return []router.Config{
		{
			Method:   "POST",
			Path:     "",
			Handler:  userCtrl.Create,
			NeedAuth: true,
		},
		{
			Method:   "GET",
			Path:     "/:id",
			Handler:  userCtrl.Get,
			NeedAuth: true,
		},
		{
			Method:   "PUT",
			Path:     "/:id",
			Handler:  userCtrl.Update,
			NeedAuth: true,
		},
		{
			Method:   "DELETE",
			Path:     "/:id",
			Handler:  userCtrl.Delete,
			NeedAuth: true,
		},
	}
}
